<?php

namespace Portal\CommentBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Portal\MainBundle\Utils\customFunctions;
class CommentController extends Controller
{
    public function commentListAction($tableName, $tableId)
    {
      $tableName = customFunctions::clear($tableName);
      $tableId = (int) $tableId;
      
      $commentList = $this->getDoctrine()->getEntityManager()->getRepository('PortalCommentBundle:Comment')->getCommentList($tableName, $tableId);
      return $this->render('PortalCommentBundle:Comment:commentList.html.twig', array(
          'commentList' => $commentList
          ));
    }
}
